home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 2
/
Atari Mega Archive CD - Volume 2.iso
/
8bit
/
cislib_a
/
exec.act
< prev
next >
Wrap
Text File
|
1995-04-22
|
1KB
|
66 lines
;Com_Exec, by Craig S. Thom 1987
;This PROC, when used with SpartaDOS
;v2.5 or greater, will allow the
;execution of ANY command processor
;command from within an Action!
;program. For example, Com_Exec("DIR D2:")
;will print the directory of D2: to
;the screen without otherwise altering
;the execution of any program.
;Care should be taken when executing
;external commands, however, since
;they may overwrite program memory.
PROC VXCOMLI()
;LDA PORTB ;gets bank select status
;PHA ;and saves on stack.
;AND #FE ;resets bit 0, disabling
;STA PORTB ;ROM $C000-$CFFF & $F000-$FFFF.
;JSR VXCOMLI ;calls execute routine.
;PLA ;restores bank select
;STA PORTB ;status.
;RTS ;return.
[$AD$01$D3$48$29$FE$8D$01$D3
$20$D2$FF$68$8D$01$D3$60]
PROC Com_Exec(BYTE ARRAY command)
CARD POINTER DOSVEC
BYTE POINTER LBUF,
BUFOFF
BYTE Sparta =$700,
version=$701,
i
IF Sparta<>$53 OR version<$25 THEN
PrintE("ComEx works only with SpartaDOS v2.5")
PrintE("or greater.")
RETURN
FI
IF command(0)>64 THEN
PrintE("Command too long!")
RETURN
FI
DOSVEC=$000A
LBUF=DOSVEC^+63
BUFOFF=DOSVEC^+10
BUFOFF^=0 ;set buffer offset to 0
FOR i=1 TO command(0);Copy command into
DO ;CP buffer
LBUF^=command(i)
LBUF==+1
OD
LBUF^=$9B
VXCOMLI()
RETURN
MODULE
99999999999999999999999999999999999999999999999999999999999999999999999